package astri.pdcontrol.commclient;

/**
 * Class that defines the structure of the AstComm message.<br />
 * All the messages send through AstComm MUST follow this structure.
 * 
 * @author Shing, Echo @ASTRI
 */
public final class AstCommMessage {
	/**
	 * Message Header
	 */
	public AstCommMessageHeader header = new AstCommMessageHeader();
	
	/**
	 * Message Data
	 */
	public byte[] data = null;

	/**
	 * This class defines the structure of the AstComm message header.
	 * @author Shing, Echo
	 * 
	 */
	public final class AstCommMessageHeader {
		/**
		 * magic is the identity code that shares between the server and client.
		 * Server will handle messages with the recognized magic only. 
		 */
		public int  magic;

		/**
		 * id is the message id that is defined by the communication protocol.
		 */
		public int  id;

		/**
		 * length is the size of the message body.
		 */
		public int  length;
	}
	
	
}